-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v3 - add field trans to linkTitle and add lang as async #712
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -191,7 +193,7 @@ export const link = defineField({ | |||
prepare(selection) { | |||
const { title, type } = selection; | |||
return { | |||
title: title, | |||
title: title[0].value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To not overcomplicate this I've set it to index [0]. That might be an English translation or a Norwegian, but not something we can spend time on now.
@@ -14,6 +14,8 @@ import { apiVersion, dataset, projectId } from "./env"; | |||
import { schema } from "./schema"; | |||
import { legalDocumentID } from "./schemas/documents/admin/legalDocuments"; | |||
|
|||
const SUPPORTED_LANGUAGES_QUERY = `*[_type == "languageSettings" && !(_id in path("drafts.*"))].languages[]{id, title}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drafts are already filtered out in production, so do we need to check that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, it's just that when testing in staging we get duplicates. 🤪
So a list of English, Norwegian, English, Norwegian....
Short Description
Adding field translations to Sanity for cases where we want to have translations to only specific fields.
⚠️ this does NOT support rich text ⚠️
Visual Overview (Image/Video)
If applicable, please include screenshots or a short video showcasing the changes you have made.
Insert images or videos here.
Checklist
Please ensure that you’ve completed the following checkpoints before submitting your pull request:
Additional Notes
Other comments relevant to this pull request.